package com.xiyou.weblog.admin.controller;

import com.xiyou.weblog.admin.service.AdminFileService;
import com.xiyou.weblog.common.aspect.ApiOperationLog;
import com.xiyou.weblog.common.utils.Response;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("/admin")
@Tag(name = "Admin 文章模块")
public class AdminFileController {
    @Resource
    private AdminFileService fileService;

    @PostMapping("/file/upload")
    @ApiOperationLog(description = "上传文件")
    @Operation(summary = "上传文件")
    public Response uploadFile(@RequestParam MultipartFile file) {
        return fileService.uploadFile(file);
    }
}
